<?php

namespace app\backend\validate;

use think\Validate;

class Article extends Validate
{
    protected $rule = [
        'article_id' => 'require',
        'category_id' => 'require|egt:1',
        'article_name' => 'require',
        'content' => 'require'
    ];
    protected $message = [
        'article_id.require' => 'id不能为空',
        'category_id.egt' => '不能选择顶级板块为所属栏目！',
        'category_id.require' => '请选择所属栏目',
        'article_name.require' => '请填写文章标题',
        'content.require' => '请填写文章内容'
    ];
    protected $scene = [
        'create' => ['category_id', 'article_name', 'content'],
        'update' => ['category_id', 'article_name', 'content']
    ];
}